<%@ page language="java"  contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" import="ChartDirector.*,com.ncjzw.ms.vo.*,java.util.*"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%

String[] labels = {"01", "02", "03", "04", "05", "06", "07", "08", "09",
    "10", "11", "12"};

// Create a XYChart object of size 600 x 375 pixels
XYChart c = new XYChart(1000, 570);

// Add a title to the chart using 18 pts Times Bold Italic font
c.addTitle("南充兼职网"+request.getAttribute("year")+"各校区会员走势图", "华文新魏", 15 , 0x008000).setBackground(0xE1E5EE);

c.setBackground(0xF7F8F9, 0xffffff, 1);
// Set the plotarea at (50, 55) and of 500 x 280 pixels in size. Use a vertical
// gradient color from light blue (f9f9ff) to sky blue (aaccff) as background. Set
// border to transparent and grid lines to white (ffffff).
c.setPlotArea(60, 60, 700, 450, c.linearGradientColor(0, 55, 0, 335, 0xf9fcff,
    0xaaccff), -1, Chart.Transparent, 0xffffff);

// Add a legend box at (50, 28) using horizontal layout. Use 10pts Arial Bold as
// font, with transparent background.
c.addLegend(800, 30, true, "楷体", 10).setBackground(Chart.Transparent);

// Set the x axis labels
c.xAxis().setLabels(labels);

//支持中文
c.setDefaultFonts("SIMSUN.TTC","simhei.ttf");

// Set y-axis tick density to 30 pixels. ChartDirector auto-scaling will use this as
// the guideline when putting ticks on the y-axis.
c.yAxis().setTickDensity(30);

// Set axis label style to 8pts Arial Bold
c.xAxis().setLabelStyle("楷体", 8);
c.yAxis().setLabelStyle("楷体", 8);

// Set axis line width to 2 pixels
c.xAxis().setWidth(2);
c.yAxis().setWidth(2);

// Add axis title using 10pts Arial Bold Italic font
c.yAxis().setTitle("各校区会员数量竖轴", "华文新魏", 15 , 0x008000).setBackground(0xE1E5EE);

// Add a line layer to the chart
LineLayer layer = c.addLineLayer2();

// Set the line width to 3 pixels
layer.setLineWidth(3);

@SuppressWarnings("all")
List<MonthGoChartVO> mgcvolist = (ArrayList)request.getAttribute("data");


int[] color = {0xF65327, 0x02AA52, 0x005BF2, 0xF3D00C, 0x1B3142, 0xFFFFFF, 0xC09200, 0xC09200, 0x18A5F7,
    0xD9A61B, 0x008000,0x001100,0xFFFF00, 0x9D2101,0x38B8F4,0x38B804,0x38B824,0x38B844,0x38B864,0x38B884,0x38B8A4,0x38B8E4,0xF3DF0C,
    0xF3D000,0xFED00C,0xF65327,0x005B00,0xF3000C};

int len = mgcvolist.size();
MonthGoChartVO mgcvo = null;

for(int i = 0 ;i<len ;i++)
{
     mgcvo = mgcvolist.get(i);
     @SuppressWarnings("all")
     List<Integer> numlist = mgcvo.getNum();
	 double[] data =  new double[12];
	 for(int j = 0 ;j<numlist.size() ;j++)
	 {
	  data[j] = numlist.get(j);
	 }

	// Add the three data sets to the line layer, using circles, diamands and X shapes as
	// symbols
	layer.addDataSet(data, color[i],mgcvo.getSname()).setDataSymbol(i, 8);
}


// output the chart
String chart1URL = c.makeSession(request, "chart1");

// Include tool tip for the chart
String imageMap1 = c.getHTMLImageMap("", "",
    "title='{dataSetName}{xLabel}月份会员数:{value}人'");
%>
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	background-color: #F8F9FA;
}
-->
</style>
<%
     if(session.getAttribute("msg")!=null)
     {
       %>
        <script type="text/javascript">
         alert('<%=session.getAttribute("msg")%>');  
        </script>
       <%
       session.removeAttribute("msg");
     }
     %>
<link href="<%=basePath%>admin/images/skin.css" rel="stylesheet" type="text/css" />
<body>
	<form method="POST" action="member!getMemberMonthGoChart.action">
		<table width="100%" border="0" cellpadding="0" cellspacing="0">
			<tr>
				<td width="17" height="29" valign="top"
					background="<%=basePath%>admin/images/mail_leftbg.gif">
					<img src="<%=basePath%>admin/images/left-top-right.gif" width="17" height="29" />
				</td>
				<td width="935" height="29" valign="top"
					background="<%=basePath%>admin/images/content-bg.gif">
					<table width="100%" height="31" border="0" cellpadding="0"
						cellspacing="0" class="left_topbg" id="table2">
						<tr>
							<td height="31">
								<div class="titlebt">
									月份走势图
								</div>
							</td>
						</tr>
					</table>
				</td>
				<td width="16" valign="top"
					background="<%=basePath%>admin/images/mail_rightbg.gif">
					<img src="<%=basePath%>admin/images/nav-right-bg.gif" width="16" height="29" />
				</td>
			</tr>
			<tr>
				<td height="71" valign="middle"
					background="<%=basePath%>admin/images/mail_leftbg.gif">
					&nbsp;
				</td>
				<td valign="top" bgcolor="#F7F8F9">
					<table width="100%" height="138" border="0" cellpadding="0"
						cellspacing="0">
						
						<tr>
							<td valign="top">
								<table width="98%" border="0" align="center" cellpadding="0"
									cellspacing="0">
									<tr>
										<td class="left_txt">
											当前位置：月份走势图
										</td>
									</tr>
									<tr>
										<td height="20">
											<table width="100%" height="1" border="0" cellpadding="0"
												cellspacing="0" bgcolor="#CCCCCC">
												<tr>
													<td></td>
												</tr>
											</table>
										</td>
									</tr>
									<tr>
										<td>
											<table width="100%" height="55" border="0" cellpadding="0"
												cellspacing="0">
												<tr>
													<td width="10%" height="55" valign="middle">
														<img src="<%=basePath%>admin/images/title.gif" width="54" height="55">
													</td>
													<td width="90%" valign="top">
														<span class="left_txt2">在这里，您可以根据您的网站要求，修改设置网站的</span><span
															class="left_txt3">基本参数</span><span class="left_txt2">！</span>
														<br>
														<span class="left_txt2">包括</span><span class="left_txt3">网站名称，网址，网站备案号，联系方式，网站公告，关键词，风格</span><span
															class="left_txt2">等以及网站</span><span class="left_txt3">会员及等级积分设置</span><span
															class="left_txt2">。 </span>
													</td>
												</tr>
											</table>
										</td>
									</tr>
									<tr>
										<td>
											<table width="100%" height="31" border="0" cellpadding="0"
												cellspacing="0" class="nowtable">
												<tr>
													<td class="left_bt2">
														&nbsp;&nbsp;&nbsp;&nbsp;月份走势图
													</td>
												</tr>
											</table>   
										</td>
									</tr>
									<tr>
										<td height="550">
										 <table border="0" width="100%">
										  <tr>
										   <td>
										    <font size="2">选择年份:</font>&nbsp;&nbsp;
										    <select name="year">   
										          <option value="2007">2007</option>
										          <option value="2008">2008</option>
										          <option value="2009">2009</option>
										          <option selected value="2010">2010</option>
										          <option value="2011">2011</option>
										          <option value="2012">2012</option>
										          <option value="2013">2013</option>
										          <option value="2014">2014</option>
										          <option value="2015">2015</option>
										          <option value="2016">2016</option>
										          <option value="2017">2017</option>
										          <option value="2018">2018</option>
										          <option value="2019">2019</option>
										          <option value="2020">2020</option>
										    </select>
										    &nbsp;&nbsp;&nbsp;&nbsp;
										    <input type="submit" value="查&nbsp;询"><br>
										    <img src='<%=basePath%><%=response.encodeURL("utils/getchart.jsp?"+chart1URL)%>'
                                             usemap="#map1" border="0">
                                            <map name="map1"><%=imageMap1%></map>										  
										   </td>
										  </tr>
										 </table>
										
											
										</td>
									</tr>
								</table>
							</td>
						</tr>
					</table>
				</td>
				<td background="<%=basePath%>admin/images/mail_rightbg.gif">
					&nbsp;
				</td>
			</tr>
			<tr>
				<td valign="middle" background="<%=basePath%>admin/images/mail_leftbg.gif">
					<img src="<%=basePath%>admin/images/buttom_left2.gif" width="17" height="17" />
				</td>
				<td height="17" valign="top"
					background="<%=basePath%>admin/images/buttom_bgs.gif">
					<img src="<%=basePath%>admin/images/buttom_bgs.gif" width="17" height="17" />
				</td>
				<td background="<%=basePath%>admin/images/mail_rightbg.gif">
					<img src="<%=basePath%>admin/images/buttom_right2.gif" width="16" height="17" />
				</td>
			</tr>
		</table>
	</form>
</body>
